// 将getters放到顶层,是为了方便获取state,快捷访问
// 全局getters  目的：创建快捷访问  方便组件访问模块中的数据
const getters = {
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  token: state => state.user.token,
  avatar: state => state.user.userInfo.staffPhoto,
  name: state => state.user.userInfo.username,
  mobile: state => state.user.userInfo.mobile,
  department: state => state.user.userInfo.departmentName,
  workNumber: state => state.user.userInfo.workNumber
  // 等同于
  // mobile (state) {
  //   return state.user.userInfo
  // }
  // store.getters.token === store.state.user.token
}
export default getters
// getters类似computed,只不过计算的是state
